package com.spr.controller;

import com.spr.service.SprDevicePushRecordService;
import com.spr.vo.SprDeviceInfoVO;
import com.spr.vo.SprDevicePushRecordVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sprDevicePushRecord")
@Slf4j
@Api(tags = "设备向上推进记录-控制类")
public class SprDevicePushRecordController {
    @Autowired
    private SprDevicePushRecordService sprDevicePushRecordService;

    @ApiOperation(value = "实时状态信息")
    @GetMapping("/realTimeStatus")
    public ResponseEntity<List<SprDevicePushRecordVO>> realTimeStatus(){
        List<SprDevicePushRecordVO> sprDevicePushRecordVOS= sprDevicePushRecordService.getRealTimeStatus();
        return ResponseEntity.ok(sprDevicePushRecordVOS);
    }

    @ApiOperation(value = "正常运行天数")
    @GetMapping("/operationNumber")
    public ResponseEntity<List<SprDevicePushRecordVO>> operationNumber(){
        List<SprDevicePushRecordVO> sprDevicePushRecordVOS= sprDevicePushRecordService.getOperationNumber();
        return ResponseEntity.ok(sprDevicePushRecordVOS);
    }


    @ApiOperation(value = "设备向上推送记录")
    @GetMapping("/devicePushRecord")
    public ResponseEntity<List<SprDevicePushRecordVO>> getDevicePushRecord(){
        List<SprDevicePushRecordVO> sprDevicePushRecordVOS= sprDevicePushRecordService.getDevicePushRecord();
        return ResponseEntity.ok(sprDevicePushRecordVOS);
    }



}
